package org.example.java.regExp;

/**
 *
 * Created by Juntao.Zhang on 2014/5/22.
 */
public class IntMatch {
  public static void main(String[] args) {
    System.out.println("-123".matches("-?\\d+"));
    System.out.println("-123e".matches("-?\\d+"));
    System.out.println("-+123".matches("[-?|\\+?]{0,2}\\d+"));
    System.out.println("+123".matches("[-?|\\+?]\\d+"));
    System.out.println("-123".matches("(-|\\+)?\\d+"));//?表示{0,1}
    System.out.println("-+123".matches("(-|\\+){0,2}\\d+"));
  }
}
